
void read(int sockfd)
{
	int sockfd = *((int*)fd);
	char buffer[255];
	while(true){
		memset(buffer, 0, sizeof(buffer));
		int n = read(sockfd, buffer, 255);
		if(n < 0) {
			std::cerr << "ERROR reading from socket" << std::endl;
		}
		addNewMessage();
	}
}
